-@section = 'forums'
- @page_title = search_posts_title

-box do 

  .right=link_to :forums.l, forums_path
  %h3
    - if params[:q].blank?
      = @page_title
    - else
      ="#{:searching_for.l} '#{h params[:q]}'"

  %p.subtitle
    =link_to fa_icon("rss"), all_sb_posts_path(:format => 'rss')
    =:post_found.l(:count => @posts.size)

  %table.posts.wide{ :cellspacing => "0", :border => "0", :cellpadding => "0", :width => '100%'}
    - for post in @posts do
      - unless post == @posts.to_a.first
        %tr.spacer
          %td{ :colspan => "2" }
            \&nbsp;
      %tr.post{ :id => post.dom_id }
        %td.author.vcard
          .date
            %abbr.updated{ :title => post.created_at.xmlschema }
              = time_ago_in_words(post.created_at)

          -if post.user
            = avatar_for post.user    
            %span.fn
              = link_to truncate(h(post.username), :length => 15), user_path(post.user), :class => (post.topic.editable_by?(post.user) ? "admin" : nil)
            %span.posts= pluralize post.user.sb_posts_count, :post.l
          -else
            = image_tag(configatron.photo.missing_thumb, :height => '32', :width => '32', :class => 'photo')        
            %span.fn
              =truncate(h(post.username), :length => 15)

        %td.body.entry-content
          %p.topic
            = link_to(h(post.forum_name), forum_path(post.forum))
            \/
            = link_to h(post.topic_title), forum_topic_path(post.forum, post.topic)
          =raw post.body
        
  =paginate @posts, :theme => 'bootstrap'

